# 1.py

# 获取字典内容的 另一个方法
  # 1. 不会报错，如果不对还可以设定一个预备值
  # 1. 即使不存在，也不会报错，显示None

students = { 
   'zhangsan' : '123',
   'xiaoming': '456',
   'lihua': '789',
}

print(students)
print(students['zhangsan'])
print(students['xiaoming'])
print(students['lihua'])

print('='*100)

print(students.get('lisi','bucunzai'))
print(students.get('lihua1'))
print(students.get('lihua','bucunzai'))
print(students.get('lihua1', 1))




